
package com.jzdy.adapter;

import java.util.List;

import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.jzdy.R;
import com.jzdy.core.controller.CoreAdapter;
import com.jzdy.core.utils.CoreImageLoader;
import com.jzdy.model.DingYue;

public class DingYueAdapter extends CoreAdapter<DingYue>
{
    public DingYueAdapter(Activity activity, List<DingYue> mList)
    {
        super(activity, mList);
        // TODO Auto-generated constructor stub
    }

    @Override
    public View getView(int position , View convertView , ViewGroup parent , ViewHolder viewHolder)
    {
        // TODO Auto-generated method stub
        ImageView iv_pic = viewHolder.obtainView(convertView, R.id.iv_pic);
        TextView tv_title = viewHolder.obtainView(convertView, R.id.tv_title);
        TextView tv_sort = viewHolder.obtainView(convertView, R.id.tv_sort);
        DingYue dingYue = list.get(position);
        CoreImageLoader.displayDefaultNotPeopleNotRoundImage(dingYue.imgUrl, iv_pic);
        tv_title.setText(dingYue.title);
        tv_sort.setText(dingYue.sort + "");
        return convertView;
    }

    @Override
    public int itemLayoutRes()
    {
        // TODO Auto-generated method stub
        return R.layout.dingyue_item;
    }
}
